package cn.yunhe.action;

import cn.yunhe.biz.DeptBiz;
import cn.yunhe.biz.EmpBiz;
import cn.yunhe.model.Dept;
import cn.yunhe.model.Emp;

public class EmpAction extends BaseAction {

	private String name;
	private String job;
	private String hiredate;
	private double sal;
	private int deptid;
	private DeptBiz deptBiz;
	private EmpBiz empBiz;
	
	
	
	public String seacherById(){
		Dept dept=deptBiz.seacherById(deptid);
		
		Emp emp=new Emp();
		emp.setName(name);
		emp.setJob(job);
		emp.setHiredate(hiredate);
		emp.setSal(sal);
		emp.setDept(dept);
		
		empBiz.insertEmp(emp);
		
		return SUCCESS;
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getJob() {
		return job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	public String getHiredate() {
		return hiredate;
	}

	public void setHiredate(String hiredate) {
		this.hiredate = hiredate;
	}

	public double getSal() {
		return sal;
	}

	public void setSal(double sal) {
		this.sal = sal;
	}

	public int getDeptid() {
		return deptid;
	}

	public void setDeptid(int deptid) {
		this.deptid = deptid;
	}

	public DeptBiz getDeptBiz() {
		return deptBiz;
	}

	public void setDeptBiz(DeptBiz deptBiz) {
		this.deptBiz = deptBiz;
	}

	public EmpBiz getEmpBiz() {
		return empBiz;
	}

	public void setEmpBiz(EmpBiz empBiz) {
		this.empBiz = empBiz;
	}	
}
